home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / coolcolr.zip / GLOBAL.H < prev    next >
C/C++ Source or Header  |  1992-11-17  |  9KB  |  208 lines

  1. //****************************************************************************
  2. //      File:  GLOBAL.H                                                    
  3. //                                                                         
  4. //   Purpose:  Define function prototypes, structures and global variables.
  5. //                                                                         
  6. // Development Team:
  7. //
  8. //       Greg Keyser
  9. //
  10. // Written by Microsoft Product Support Services, Windows Developer Support
  11. // Copyright (c) 1992 Microsoft Corporation. All rights reserved.
  12. //****************************************************************************
  13.  
  14.  
  15. /****************************************************************************
  16. *                                                                           *
  17. *                             FUNCTION PROTOTYPES                           *
  18. *                                                                           *
  19. ****************************************************************************/
  20.  
  21. long  FAR PASCAL MainWndProc        (HWND, unsigned, WORD, LONG);
  22. int       PASCAL WinMain            (HANDLE, HANDLE, LPSTR, int);
  23. void  FAR PASCAL ProcessCDError     (DWORD                     );
  24. void  FAR PASCAL ReportError        (WORD                      );
  25. BOOL  FAR PASCAL AboutDlg           (HWND, unsigned, WORD, LONG);
  26. BOOL  FAR PASCAL ColorHook          (HWND, unsigned, WORD, LONG);
  27. int   FAR PASCAL GetUpdateArea      (HWND, BOOL FAR *, LONG, LPSTR, LPSTR,
  28.                                      LONG, HWND);
  29. void  FAR PASCAL LaunchApplet       (void                      );
  30. void  FAR PASCAL SaveToWinIni       (void                      );
  31. void  FAR PASCAL GetCurrentSysColors(void                      );
  32.  
  33.  
  34. /****************************************************************************
  35. *                                                                           *
  36. *                             CONSTANTS                                     *
  37. *                                                                           *
  38. ****************************************************************************/
  39.  
  40. #define IDC_COLORS                     1
  41. #define NUM_APPLETS                    1
  42. #define COOLCOLR_ICON                  1
  43. #define IDS_NAME                     100
  44. #define IDS_INFO                     200
  45.  
  46. #define NUMCOLORSSUPPORTED            21     // Number of different system colors
  47.                                              // this app will let you change.
  48.  
  49. #define MAXSTRINGDESCLEN              64     // Max length of description string
  50.  
  51. #define AboutBoxName             "ABOUT"     // Name of About Box in RC file.
  52.  
  53. //Error constants
  54.  
  55. #define IDC_ALLOCFAIL                   1
  56. #define IDC_LOCKFAIL                    2
  57. #define IDC_LOADSTRINGFAIL              3
  58.  
  59. //Color index constants
  60.  
  61. #define IDC_COLOR_MENUTEXT              0
  62. #define IDC_COLOR_MENU                  1
  63. #define IDC_COLOR_CAPTIONTEXT           2
  64. #define IDC_COLOR_ACTIVECAPTION         3
  65. #define IDC_COLOR_INACTIVECAPTIONTEXT   4
  66. #define IDC_COLOR_INACTIVECAPTION       5
  67. #define IDC_COLOR_WINDOWFRAME           6
  68. #define IDC_COLOR_INACTIVEBORDER        7
  69. #define IDC_COLOR_SCROLLBAR             8
  70. #define IDC_COLOR_WINDOWTEXT            9
  71. #define IDC_COLOR_WINDOW               10
  72. #define IDC_COLOR_BACKGROUND           11
  73. #define IDC_COLOR_APPWORKSPACE         12
  74. #define IDC_COLOR_ACTIVEBORDER         13
  75. #define IDC_COLOR_GRAYTEXT             14
  76. #define IDC_COLOR_HIGHLIGHT            15
  77. #define IDC_COLOR_HIGHLIGHTTEXT        16
  78. #define IDC_COLOR_BTNHIGHLIGHT         17
  79. #define IDC_COLOR_BTNSHADOW            18
  80. #define IDC_COLOR_BTNTEXT              19
  81. #define IDC_COLOR_BTNFACE              20
  82.  
  83. // String Table Defines
  84.  
  85. #define IDS_DIALOGFAILURE               1
  86. #define IDS_STRUCTSIZE                  2
  87. #define IDS_INITIALIZATION              3
  88. #define IDS_NOTEMPLATE                  4
  89. #define IDS_NOHINSTANCE                 5
  90. #define IDS_LOADSTRFAILURE              6
  91. #define IDS_FINDRESFAILURE              7
  92. #define IDS_LOADRESFAILURE              8
  93. #define IDS_LOCKRESFAILURE              9
  94. #define IDS_MEMALLOCFAILURE            10
  95. #define IDS_MEMLOCKFAILURE             11
  96. #define IDS_NOHOOK                     12
  97. #define IDS_SETUPFAILURE               13
  98. #define IDS_SUBCLASSFAILURE            14
  99. #define IDS_BUFFERTOOSMALL             16 
  100.  
  101. #define IDS_COLOR_MENUTEXT             17
  102. #define IDS_COLOR_MENU                 18
  103. #define IDS_COLOR_CAPTIONTEXT          19
  104. #define IDS_COLOR_ACTIVECAPTION        20
  105. #define IDS_COLOR_INACTIVECAPTIONTEXT  21
  106. #define IDS_COLOR_INACTIVECAPTION      22
  107. #define IDS_COLOR_WINDOWFRAME          23
  108. #define IDS_COLOR_INACTIVEBORDER       24
  109. #define IDS_COLOR_SCROLLBAR            25
  110. #define IDS_COLOR_WINDOWTEXT           26
  111. #define IDS_COLOR_WINDOW               27
  112. #define IDS_COLOR_BACKGROUND           28
  113. #define IDS_COLOR_APPWORKSPACE         29
  114. #define IDS_COLOR_ACTIVEBORDER         30
  115. #define IDS_COLOR_GRAYTEXT             31
  116. #define IDS_COLOR_HIGHLIGHT            32
  117. #define IDS_COLOR_HIGHLIGHTTEXT        33
  118. #define IDS_COLOR_BTNHIGHLIGHT         34
  119. #define IDS_COLOR_BTNSHADOW            35
  120. #define IDS_COLOR_BTNTEXT              36
  121. #define IDS_COLOR_BTNFACE              37
  122. #define IDS_NOTHING                    38
  123. #define IDS_SYSTEMCOLORDROPPER         39
  124.  
  125. #define IDS_PROGTITLE                  40
  126. #define IDS_MAINMENUNAME               41
  127. #define IDS_MAINCLASSNAME              42
  128.  
  129.  
  130. /****************************************************************************
  131. *                                                                           *
  132. *                          COLORS STRUCTURE                                 *
  133. *                                                                           *
  134. ****************************************************************************/
  135. typedef struct tagCOLORSCHUNK
  136.    {
  137.       CHOOSECOLOR chsclr;
  138.       DWORD dwColor;                    
  139.       DWORD dwCustClrs[16];       
  140.    }
  141. COLORSCHUNK;
  142.  
  143. typedef COLORSCHUNK FAR *LPCOLORSCHUNK; 
  144.  
  145. typedef WORD (CALLBACK* FARHOOK)(HWND,unsigned,WPARAM,LPARAM);
  146.  
  147. /****************************************************************************
  148. *                                                                           *
  149. *                          GLOBAL VARIABLES                                 *
  150. *                                                                           *
  151. * Global variables defined in this header.  One .C file (INIT.C) should have*
  152. * IN_INIT #define'd prior to including this header -- it's in that          *
  153. * C module where these variables will reside.                               *
  154. *                                                                           *
  155. ****************************************************************************/
  156.  
  157. #ifdef IN_INIT
  158. #define EXTERN
  159. #define GLOBALCHAR(p1, p2) char p1=p2;
  160. #endif
  161.  
  162. #ifndef IN_INIT
  163. #define EXTERN extern
  164. #define GLOBALCHAR(p1, p2) char p1; 
  165. #endif
  166.  
  167. EXTERN HANDLE        ghInst;             // Handle to this instance
  168. EXTERN HWND          ghWnd;              // Handle to main window
  169. EXTERN LPCOLORSCHUNK glpColorsChunk;
  170. EXTERN HANDLE        ghColorsChunk;
  171. EXTERN DWORD         gdwOldSysColors[NUMCOLORSSUPPORTED];
  172. EXTERN BOOL          gbSystemColorHasChanged;
  173.  
  174. GLOBALCHAR           (gszAppName[],  "Color Dropper");
  175. GLOBALCHAR           (gszMenuName[], "CommonDlgMenu");
  176. GLOBALCHAR           (gszAllocErrorMsg[], "Error Allocating Memory!");
  177. GLOBALCHAR           (gszLockErrorMsg[], "Error Locking Memory!");
  178. GLOBALCHAR           (gszLoadStrFail[], "LoadString failed!");
  179.  
  180. #ifdef IN_INIT
  181. int giSysColorArea[]={COLOR_MENUTEXT,
  182.                       COLOR_MENU,
  183.                       COLOR_CAPTIONTEXT,
  184.                       COLOR_ACTIVECAPTION,
  185.                       COLOR_INACTIVECAPTIONTEXT,
  186.                       COLOR_INACTIVECAPTION,
  187.                       COLOR_WINDOWFRAME,
  188.                       COLOR_INACTIVEBORDER,
  189.                       COLOR_SCROLLBAR,
  190.                       COLOR_WINDOWTEXT,
  191.                       COLOR_WINDOW,
  192.                       COLOR_BACKGROUND,
  193.                       COLOR_APPWORKSPACE,
  194.                       COLOR_ACTIVEBORDER,
  195.                       COLOR_GRAYTEXT,     
  196.                       COLOR_HIGHLIGHT,    
  197.                       COLOR_HIGHLIGHTTEXT,
  198.                       COLOR_BTNHIGHLIGHT,
  199.                       COLOR_BTNSHADOW,
  200.                       COLOR_BTNTEXT,
  201.                       COLOR_BTNFACE};
  202. #else
  203. int giSysColorArea[];
  204. #endif
  205.               
  206.  
  207.  
  208.